<div class="isi">
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">Transaksi Retur Status Proses</a></li>
                <li><a href="#tabs-2">Transaksi Retur Status Gagal</a></li>
                <li><a href="#tabs-3">Transaksi Retur Status Sukses</a></li>
            </ul>
            <div id="tabs-1" style="padding: 10px 2px 2px 2px;">

                <table id="laporan" class="display"  >
                    <thead>
                        <tr>
                            <th width="5%">No</th>
                            <th width="20%">ID Retur</th>
                            <th>Nama Member</th>
                            <th>Tgl Retur</th>
                            <th>ID Transaksi</th>
                            <th width="5%">Tindakan</th>
                        </tr>            
                    </thead>
                    <tbody>
                        <?php
                        $tgl1 = date('Y-m-d'); // 1 Oktober 2010

                        $pecah1 = explode("-", $tgl1);
                        $date1 = $pecah1[2];
                        $month1 = $pecah1[1];
                        $year1 = $pecah1[0];

                        $n = 1;
                        $img_lihat = $this->lib_button->lihat_icon();
                        $img_delete = $this->lib_button->delete_icon();
                        foreach ($list_retur as $dt_retur) {

                            $tgl2 = $dt_retur->tgl_retur; // 10 Oktober 2010
                            $date2 = substr($tgl2, 8, 2);
                            $month2 = substr($tgl2, 5, 2);
                            $year2 = substr($tgl2, 0, 4);

                            $jd1 = GregorianToJD($month1, $date1, $year1);
                            $jd2 = GregorianToJD($month2, $date2, $year2);

                            //pengurangan jadi nilai hari
                            $selisih = $jd1 - $jd2;



                            if ($dt_retur->status == 0 and $selisih <= 7) {
                                $link_lihat = anchor('admin_retur/view_det/' . $dt_retur->id, $img_lihat);
                                $link_hapus = anchor('admin_retur/delete/' . $dt_retur->id, $img_delete, array('onClick' => 'return confirm(\'Apa anda yakin akan menghapus data ini ?\');'));

                                echo "<tr>";
                                echo "<td> $n  </td>";
                                echo "<td> $dt_retur->id  </td>";
                                echo "<td> $dt_retur->nama_member  </td>";
                                echo "<td> $dt_retur->tgl_retur  </td>";
                                echo "<td> $dt_retur->id_transaksi  </td>";
                                echo "<td> $link_lihat $link_hapus</td>";
                                echo "</tr>";
                                $n++;
                            }
                        }
                        ?>
                    </tbody>
                </table>   

            </div>


            <div id="tabs-2" style="padding: 10px 2px 2px 2px;">
                <table id="laporan2" class="display"  >
                    <thead>
                        <tr>
                            <th width="5%">No</th>
                            <th width="20%">ID Retur</th>
                            <th>Nama Member</th>
                            <th>Tgl Retur</th>
                            <th>ID Transaksi</th>
                            <th width="5%">Tindakan</th>
                        </tr>            
                    </thead>
                    <tbody>
                        <?php
                        $n = 1;

                        foreach ($list_retur as $dt_retur) {


                            $tgl2 = $dt_retur->tgl_retur; // 10 Oktober 2010
                            $date2 = substr($tgl2, 8, 2);
                            $month2 = substr($tgl2, 5, 2);
                            $year2 = substr($tgl2, 0, 4);

                            $jd1 = GregorianToJD($month1, $date1, $year1);
                            $jd2 = GregorianToJD($month2, $date2, $year2);

                            //pengurangan jadi nilai hari
                            $selisih = $jd1 - $jd2;

                            if ($dt_retur->status == 1 || $selisih >= 7) {
                                $link_lihat = anchor('admin_retur/view_det/' . $dt_retur->id, $img_lihat);
                                $link_hapus = anchor('admin_retur/delete/' . $dt_retur->id, $img_delete, array('onClick' => 'return confirm(\'Apa anda yakin akan menghapus data ini ?\');'));

                                echo "<tr>";
                                echo "<td> $n  </td>";
                                echo "<td> $dt_retur->id  </td>";
                                echo "<td> $dt_retur->nama_member  </td>";
                                echo "<td> $dt_retur->tgl_retur  </td>";
                                echo "<td> $dt_retur->id_transaksi  </td>";
                                echo "<td> $link_lihat $link_hapus </td>";
                                echo "</tr>";
                                $n++;
                            }
                        }
                        ?>
                    </tbody>
                </table>                  
            </div>

            <div id="tabs-3" style="padding: 10px 2px 2px 2px;">
                <table id="laporan3" class="display"  >
                    <thead>
                        <tr>
                            <th width="5%">No</th>
                            <th width="20%">ID Retur</th>
                            <th>Nama Member</th>
                            <th>Tgl Retur</th>
                            <th>ID Transaksi</th>
                            <th width="5%">Tindakan</th>
                        </tr>            
                    </thead>
                    <tbody>
                        <?php
                        $n = 1;
                        foreach ($list_retur as $dt_retur) {
                            if ($dt_retur->status == 2) {
                                $link_lihat = anchor('admin_retur/view_det/' . $dt_retur->id, $img_lihat);
                                $link_hapus = anchor('admin_retur/delete/' . $dt_retur->id, $img_delete, array('onClick' => 'return confirm(\'Apa anda yakin akan menghapus data ini ?\');'));

                                echo "<tr>";
                                echo "<td> $n  </td>";
                                echo "<td> $dt_retur->id  </td>";
                                echo "<td> $dt_retur->nama_member  </td>";
                                echo "<td> $dt_retur->tgl_retur  </td>";
                                echo "<td> $dt_retur->id_transaksi  </td>";
                                echo "<td> $link_lihat $link_hapus </td>";
                                echo "</tr>";
                                $n++;
                            }
                        }
                        ?>
                    </tbody>
                </table>                  
            </div>            

        </div>        

    <div class="clear"></div>
</div>